import { reqOrderList } from "@/api";
const actions = {
  async getOrderList({commit},{page,limit}){
    let res = await reqOrderList(page,limit);
    if(res.code == 200){
      commit('ORDER_LIST',res.data);
    }
  }
};
const mutations = {
  ORDER_LIST(state,orderList){
    state.orderList = orderList;
  }
};
const state = {
  orderList:[],
};
const getters ={
  orderList(state){
    return state.orderList || {};
  },
  records(state){
    return state.orderList.records || [];
  }
};
export default {
  namespaced:true,
  actions,
  mutations,
  state,
  getters,
}